package org.zero.onlinesubject.utils;

import java.util.ArrayList;
import java.util.List;

public class ProcUtil {
    private static final List<Process> processList = new ArrayList<>();

    public static void add(Process process){
        processList.add(process);
    }

    public static void remove(Process process){
        processList.remove(process);
    }

    public static void destoryAll(){
        processList.forEach(process -> {
            if(process.isAlive()){
                process.destroy();
            }
        });
    }
}
